<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>往来单位设置</title>
    <link rel="stylesheet" href="http://static-online.zhaogangtest.com/publicresource/css/bootstrap-table.css">
    <link rel="stylesheet" href="../../../resources/public/css/iconfont.min.css">
    <link rel="stylesheet" href="../../../resources/public/css/table.css">
    <link rel="stylesheet" href="../../../resources/public/css/scmstrap.css">
</head>

<body>
    <div class="leftside-sub">
        <div class="leftside-subTitle">品类</div>
        <div class="leftside-subinner">
            <div class="radio-list">
                <ul>
                    <li>
                        <label class="mycheckradio">
                            <em></em>江阴
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>杭州
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>宁波
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>台州
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>直发
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>门市
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>上海
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>江苏
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>阳东
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>无锡
                        </label>
                    </li>
                    <li>
                        <label class="mycheckradio">
                            <em></em>常州
                        </label>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="main main-sub">
        <!-- 条件区域 -->
        <div class="form-list">
            <div class="group">
                <label>单位名称</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input" placeholder="">
                </div>
            </div>
            <div class="group">
                <label>单位简称</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input" placeholder="">
                </div>
            </div>
        </div>
        <!-- 按钮 -->
        <div class="operation">
            <div class="conditionbtn">
                <button class="scm-btn blue">
                    <i class="anticon icon-search1"></i>查询</button>
                <button class="scm-btn resetBtn">
                    <i class="anticon icon-delete"></i>重置</button>
            </div>
            <!-- 按钮组 -->
            <div class="scm-btn-group fr">
                <button class="scm-btn btn-select-department">
                    <i class="anticon icon-solution1"></i>结算部门</button>
                <button class="scm-btn btn-add-unit">
                    <i class="anticon icon-plus"></i>添加</button>
                <button class="scm-btn btn-adjust-unit">
                    <i class="anticon icon-edit1"></i>修改</button>
            </div>
        </div>
        <div class="box-table box-tableTr">
            <table class="table table-condensed" id="table-name"></table>
        </div>
    </div>
    <!-- 结算部门（部门选择） -->
    <div class="layer-select-department" style="display: none">
        <form class="hascheck" role="form">
            <div class="form-list  nofloat nofloat-multiple-checkbox">
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>销售部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>中板下线点</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>中板计划科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>测试部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>中板发货处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>中板统计</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>中板生产部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>常州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>无锡办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>江阴办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>南华办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>财务科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>杭州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>宁波办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>台州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>螺纹发货处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>螺纹统计科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>螺纹生产部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>螺纹质检科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox "><em></em>长达企管部</label>
                </div>
            </div>
        </form>
    </div>
    <!-- 添加往来单位 -->
    <div class="layer-add-unit" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                <div class="group group-form-style">
                    <label><b class="must">*</b>单位名称</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style">
                    <label><b class="must">*</b>单位简称</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style group-select">
                    <label><b class="must">*</b>单位类型</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="供货商">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style group-select">
                    <label><b class="must">*</b>所属地区</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="杭州">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style group-select">
                    <label><b class="must">*</b>销售品类</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="中板">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-select group-form-style group-selectSearch">
                    <label>到站</label>
                    <div class="selectshowAction scm-input-wrap  selectshow" id="company1">
                        <input type="text" class="scm-input" placeholder="">
                    </div>
                    <div class="select-search select" style="display: none;">
                        <div class="select-search-container" id="companywrap1">
                        </div>
                    </div>
                </div>
                <div class="group group-form-style">
                    <label>助记码</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style">
                    <label>联系人</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style">
                    <label>联系电话</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style group-select">
                    <label>状态</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="启用">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style">
                    <label>收货地址</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style group-select">
                    <label>业务员</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="admin">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style group-select">
                    <label>未开款开单</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="不允许">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style long-input-style">
                    <label>备注</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 修改往来单位 -->
    <div class="layer-adjust-unit" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                <div class="group group-form-style">
                    <label><b class="must">*</b>单位名称</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input" value="浙江华清钢铁贸易有限公司">
                    </div>
                </div>
                <div class="group group-form-style">
                    <label><b class="must">*</b>单位简称</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input" value="华清钢铁">
                    </div>
                </div>
                <div class="group group-form-style group-select">
                    <label><b class="must">*</b>单位类型</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="供货商">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style group-select">
                    <label><b class="must">*</b>所属地区</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="杭州">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style group-select">
                    <label><b class="must">*</b>销售品类</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="中板">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-select group-form-style group-selectSearch">
                    <label>到站</label>
                    <div class="selectshowAction scm-input-wrap  selectshow" id="company1">
                        <input type="text" class="scm-input" placeholder="">
                    </div>
                    <div class="select-search select" style="display: none;">
                        <div class="select-search-container" id="companywrap1">
                        </div>
                    </div>
                </div>
                <div class="group group-form-style">
                    <label>助记码</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style">
                    <label>联系人</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style">
                    <label>联系电话</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style group-select">
                    <label>状态</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="启用">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style">
                    <label>收货地址</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-form-style group-select">
                    <label>业务员</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="admin">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style group-select">
                    <label>未开款开单</label>
                    <div class="selectshow selectshowAction scm-input-wrap">
                        <input type="text" class="scm-input hand" readonly="" placeholder="不允许">
                    </div>
                    <ul class="select" style="display: none;">
                        <li>全部</li>
                        <li>未结单</li>
                        <li>已结单</li>
                    </ul>
                </div>
                <div class="group group-form-style long-input-style">
                    <label>备注</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="http://static-online.zhaogangtest.com/publicresource/js/require.js"></script>
    <script>
    require.config({
        paths: {
            "jquery": "../../../resources/public/js/jquery.min",
            "bootstrap": 'http://static-online.zhaogangtest.com/publicresource/js/bootstrap.min',
            "bootstrap-table": "../../../resources/public/js/bootstrap-table",
            "layer": "http://static-online.zhaogangtest.com/publicresource/control/layer/layer.min",
            "public": "../../../resources/public/js/public",
            "chinese": "../../../resources/public/js/chinese",
        },
        shim: {
            "jquery": {
                exports: ['jQuery', '$']
            },
            "bootstrap": {
                deps: ["jquery"]
            },
            "bootstrap-table": {
                deps: ["jquery", "bootstrap"]
            },



            "layer": {
                deps: ["jquery"],
                exports: "layer"
            },


            "public": {
                deps: ["jquery", "bootstrap-table"]
            },

            "chinese": {
                deps: ["jquery", "bootstrap-table"],
            },

        }
    });
    require(["public", "layer", "chinese"], function() {
        layer.config({
            path: 'http://static-online.zhaogangtest.com/publicresource/control/layer/'
        });
        $(function() {
            var page = {
                $table: $('#table-name'),
                $tableSelectDepartment: $('#table-select-department'),
                init: function() {
                    this.bootstrapTable();
                    this.fn_layer();
                    this.fn_getTrData();
                    this.fn_deleteKind();


                    $(window).resize(function() {
                        page.$table.bootstrapTable('resetView', {
                            height: page.getHeight()
                        });
                    });
                },

                fn_layer: function() {
                    // 添加品类
                    // 添加品名
                    $(document).on("click", ".btn-select-department", function() {
                        var index = layer.open({
                            type: 1, //page层
                            area: ['730px', '400px'],
                            title: '部门选择',
                            shadeClose: false,
                            btn: ['保存', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-select-department'),
                            skin: "skin-searchMore",
                            yes: function(index) {
                                layer.close(index)
                            }
                        });
                    })

                    $(document).on('click', '.btn-add-unit', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['800px', '340px'],
                            title: '添加往来单位',
                            shadeClose: false,
                            btn: ['保存', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-add-unit'),
                            skin: "skin-searchMore skin-overflow",
                            yes: function() {}
                        });
                    })

                    $(document).on('click', '.btn-adjust-unit', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['800px', '340px'],
                            title: '修改往来单位',
                            shadeClose: false,
                            btn: ['保存', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-adjust-unit'),
                            skin: "skin-searchMore skin-overflow",
                            yes: function() {}
                        });
                    })
                },
                bootstrapTable: function() {
                    page.$table.bootstrapTable({
                        pagination: true, //在表格底部显示分页工具栏
                        pageSize: 50,
                        pageNumber: 1,
                        pageList: [10, 25, 50, 100],
                        height: this.getHeight(),
                        showFooter: false,
                        showColumns: false,
                        showRefresh: false,
                        //                    showToggle:true,
                        search: false,
                        //                    showPaginationSwitch:true,
                        // detailView: true,
                        // detailFormatter: this.showChild,
                        // onExpandRow: this.expandRow,
                        // onCollapseRow: this.collapseRow,
                        locales: 'zh-CN',

                        uniqueId: "id",
                        fixedColumns: true,
                        url: '../data/warrantybook/tablelist-dictionary.json',
                        sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）

                        columns: [{
                            "field": "n0",
                            "title": "状态",
                        }, {
                            "field": "n1",
                            "title": "字典名称",

                        }, {
                            "field": "n2",
                            "title": "字典代码",
                        }, {
                            "field": "n3",
                            "title": "字典值",

                        }, {
                            "field": "n4",
                            "title": "创建人",

                        }, {
                            "field": "n5",
                            "title": "创建时间",

                        }]
                    });
                },
                // 表格高度
                getHeight: function() {
                    var height = public.fn_tableHeight()
                    return $(window).height() - height;
                },
                //获取选中行数据
                fn_getTrData: function() {
                    $(document).on('click', '.box-tableTr .table tbody>tr', function() {
                        var id = $(this).closest('tr').attr('data-uniqueid');
                        if ($(this).hasClass('active')) {
                            var data = page.$table.bootstrapTable(
                                'getRowByUniqueId', id); //获取选中行的数据
                            console.log(data);

                        }

                    })

                },
                // 删除品类
                fn_deleteKind: function() {
                    $(document).on('click', '.btn-deleteKind', function() {
                        $(".radio-list ul li.active").remove()
                    })
                }

            }
            page.init();
        })

    })
    </script>
</body>

</html>